<template>

  <div>
    <div class="widss">
          <el-dialog
        width="50%"
        title="添加吸烟史"
        :visible.sync="isSmoking"
        append-to-body
        :before-close="SmokClose">
          <div>
             <el-radio-group v-model="smoke_status">
                    <el-radio :label="1">吸烟</el-radio>
                    <el-radio :label="2">已戒烟</el-radio>
                  </el-radio-group>
                  <div class="numbeissBox">
                    <template>
                      每日吸烟数
                      <el-input-number v-model="smoke_num" controls-position="right" :min="1" :max='9999' class="numbeiss">
                       
                      </el-input-number>根
                    </template>

                    
                  </div>
                  <div class="numbeissBox">
                       <template>
                          <span class="demonstration">吸烟开始时间</span>
                            <el-date-picker
                              v-model="smoke_start_time"
                              type="datetime"
                              @change="getTime"
                              placeholder="选择日期时间"
                              >
                            </el-date-picker>
                          </template>
                  </div>
                  <div class="numbeissBox">
                       <template>
                          <span class="demonstration">吸烟结束时间</span>
                            <el-date-picker
                              v-model="smoke_end_time"
                              type="datetime"
                              @change="getTime1"
                              placeholder="选择日期时间"
                              >
                            </el-date-picker>
                          </template>
                  </div>
           <el-button type="primary" class="addBing guomin" @click='addSmoking()'>添加吸烟史</el-button>
          </div>
      </el-dialog>
   <el-dialog
        title="添加过敏史"
        :visible.sync="isAnaphylaxis"
        append-to-body
        class='isAnaphylaxis-dialog'
        :before-close="AnaphyClose">
          <div class="inputtext">
            <el-input
            type="textarea"
            :rows="2"
            placeholder="请输入过敏史"
            v-model="Anaphy">
            </el-input>
           <el-button type="primary" class="addBing guomin" @click="addAnaphy()">添加过敏史</el-button>
          </div>
      </el-dialog>
       <el-dialog
        
        title="添加病史"
        class='isMedical-dialog'
        :visible.sync="isMedical"
        append-to-body
        :before-close="Medicalclose">
          <div  class="isrecordDd">
            <div class="demo-input-suffix">
                    疾病名称
                    <el-input type="age" v-model="sick_name"   >
                    </el-input>
                       
                  </div>
                  <div class="numbeissBox">
                     是否继续
                      <el-radio-group v-model="sick_status">
                        <el-radio :label="1">是</el-radio>
                        <el-radio :label="2">否</el-radio>
                      </el-radio-group>
                  </div>
                  <div class="numbeissBox">
                       <template>
                          <span class="demonstration">疾病开始时间</span>
                            <el-date-picker
                              v-model="sick_start_time"
                              type="datetime"
                              @change="getTime2"
                              placeholder="选择日期时间"
                              >
                            </el-date-picker>
                          </template>
                  </div>
                  <div class="numbeissBox">
                       <template>
                          <span class="demonstration">疾病结束时间</span>
                            <el-date-picker
                              v-model="sick_end_time"
                              type="datetime"
                              @change="getTime3"
                              placeholder="选择日期时间"
                              >
                            </el-date-picker>
                          </template>
                  </div>
                <el-button type="primary" class="addBing guomin" @click="addMedical()">添加病史</el-button>
          </div>
      </el-dialog>
      <el-dialog
        width="50%"
        title="添加手术史"
        :visible.sync="isOperation"
        class='isOperation-dialog'
        append-to-body
        :before-close="erationClose">

          <div class="isrecordDd">
                 <div class="demo-input-suffix">
                      手术名称
                      <el-input type="age" v-model="surgery_name"   >
                      </el-input>
                      <template>
                        <span class="demonstration">手术日期</span>
                          <el-date-picker
                            v-model="surgery_time"
                            type="datetime"
                            @change="getTime4"
                            placeholder="选择日期时间"
                            >
                          </el-date-picker>
                        </template>
                  </div>
                  <div class="demo-input-suffix">
                    <el-input
                      type="textarea"
                      :rows="2"
                      placeholder="请输入手术备注"
                      v-model="surgery_bz">
                      </el-input>
                  </div>
           <el-button type="primary" class="addBing guomin" @click="addOperation()">添加手术史</el-button>
          </div>
      </el-dialog>
      <el-dialog
        title="添加用药记录"
        :visible.sync="isrecord"
        append-to-body
        class='isrecord-dialog'
        :before-close="isrecordClose">
          <div class="isrecordDd">
            <div class="demo-input-suffix">
            <span class="isrecordWWW">
              药物名称
            </span>
                
                <el-input type="age" v-model="pharmacy_name"></el-input>
                <span class="isrecordWWW">
              剂量
            </span>
                 
                <el-input type="age" v-model="pharmacy_dosage"></el-input>
               
            </div>
            <div class="demo-input-suffix">
                <span class="isrecordWWW">
                  频率(次/日)
                </span>
                    
                    <el-input type="age" v-model="pharmacy_rate"></el-input>
                   <span class="isrecordWWW">
                  单位
                </span>
                     
                    <el-input type="age" v-model="pharmacy_unit"></el-input>
              
            </div>
            <div class="demo-input-suffix">
              <template>
                <span class="demonstration isrecordWWW">开始时间</span>
                  <el-date-picker
                    v-model="pharmacy_start_time"
                    type="datetime"
                    @change="getTime5"
                    placeholder="选择日期时间"
                    >
                  </el-date-picker>
                </template>
                <template>
                <span class="demonstration isrecordWWW">结束时间</span>
                  <el-date-picker
                    v-model="pharmacy_end_time"
                    type="datetime"
                    @change="getTime6"
                    placeholder="选择日期时间"
                    >
                  </el-date-picker>
                </template>
            </div>
            <div class="demo-input-suffix">
            <span class="isrecordWWW">
              是否持续
            </span>
                
                      <el-radio-group v-model="pharmacy_status">
                        <el-radio :label="1">是</el-radio>
                        <el-radio :label="2">否</el-radio>
                      </el-radio-group>
            </div>
            <div class="demo-input-suffix">
                <span class="isrecordWWW">
              给药途径
            </span>
                  
                <template>
                    <el-select v-model="pharmacy_way" placeholder="请选择">
                      <el-option
                        v-for="item in pharmacyWay"
                        :key="item.name"
                        :label="item.name"
                        :value="item.name">
                      </el-option>
                    </el-select>
                  </template>
            </div>
           <el-button type="primary" class="addBing guomin" @click='addoRecord()'>添加用药记录</el-button>
          </div>
      </el-dialog>
       <el-dialog
        width="50%"
        title="添加检验结果"
        :visible.sync="istestBox"
        append-to-body
        :before-close="addtestClose">
          <div class="Signsoo"> 
            <div class="demo-input-suffix">
                  <span class='spanWW'>检验项目：</span>
                  <el-input type="age" v-model="examine_pro"></el-input>
                   
                   <span class='spanWW'>
                     检验类别：
                   </span>
                  <template>
                      <el-select v-model="examine_type" placeholder="请选择">
                        <el-option
                          v-for="item in oExamine"
                          :key="item.name"
                          :label="item.name"
                          :value="item.name">
                        </el-option>
                      </el-select>
                    </template>
                  
                  
              </div>
            <div class="demo-input-suffix">
 <span class='spanWW'>
                   检验值：  
                   </span>
              
                <el-input type="age" v-model="examine_val"></el-input>
                 <span class='spanWW'>
                     单位：
                   </span>
                
                    <el-input type="age" v-model.number="examine_unit"   >
                    </el-input>
                     
            </div>
             <div class="demo-input-suffix">
              <template>
                <span class="demonstration spanWW">检验时间：</span>
                  <el-date-picker
                    v-model="examine_time"
                    type="datetime"
                    @change="getTime7"
                    placeholder="选择日期时间"
                    >
                  </el-date-picker>
                </template>
                 
                  <span class='spanWW'>
                     阶段：
                   </span>
                    <template>
                    <el-select v-model="examine_stage" placeholder="请选择">
                      <el-option
                        v-for="item in stageArr"
                        :key="item.id"
                        :label="item.name"
                        :value="item.id">
                      </el-option>
                    </el-select>
                  </template>
                 

            </div>
            <div class="demo-input-suffix">
              临床意义判定
                    <el-select v-model="examine_judge" placeholder="请选择角色">
                        <el-option
                          v-for="item in determine"
                          :label="item.name"
                          :value="item.name"

                          >
                        </el-option>
                      </el-select>
                      <span class='spanWW'>
                     检验范围：
                   </span>
                
                <el-input type="age" v-model="examine_range"></el-input>
            </div>
            <div class="demo-input-suffix" v-if="examine_judge==3">
                       <el-input
                          type="textarea"
                          placeholder="异常数据解释"
                          v-model="examine_explain"
                          class='input-isss'>
                        </el-input>
                  </div>
             <div class="demo-input-suffix colssro">
                      注：临床意义判定：1、正常；2、异常无临床意义；3、异常有临床意义；（请填写“异常数据解释”）4、未查如果临床意义判定选择；

                  </div>
            <el-button type="primary" class="addBing guomin"  @click='addtest()'>添加检验结果</el-button>
          </div>
      </el-dialog>
      <el-dialog
        width="50%"
        title="完善生命体征"
        :visible.sync="isSigns"
        append-to-body
        :before-close="VitalClose">
            <div class="Signs">
                  <div class="demo-input-suffix">

                    收缩压(mmHg):
                    <el-input type="age" v-model.number="shrink"   >
                    </el-input>
                     脉搏(次/分):
                    <el-input type="age" v-model.number="pulse"   >
                    </el-input>
                  </div>
                  <div class="demo-input-suffix">
                    舒张压(mmHg):
                    <el-input type="age" v-model.number="diastole"   >
                    </el-input>
                     呼吸(次/分):
                    <el-input type="age" v-model.number="breathing"   >
                    </el-input>
                  </div>
                 
                  <div class="demo-input-suffix">
                    体温(℃):
                    <el-input type="age" v-model.number="temperature"   >
                    </el-input>
                    阶段：
                    <template>
                    <el-select v-model="ostage" placeholder="请选择">
                      <el-option
                        v-for="item in stageArr"
                        :key="item.id"
                        :label="item.name"
                        :value="item.id">
                      </el-option>
                    </el-select>
                  </template>
                  </div>
                  <div class="demo-input-suffix demo-input-suffixs">
                    
                    <template>
                          <span class="demonstration">测量时间:</span>
                            <el-date-picker
                              v-model="sign_time"
                              type="datetime"
                              @change="getTime8"
                              placeholder="选择日期时间"
                              >
                            </el-date-picker>
                          </template>
                
                  </div>
                  
                 
                 
            
          
                <el-button type="primary" class="addBing addBingRight" @click='addVital()'>完善生命体征</el-button>
          </div>
      </el-dialog>
    </div>
  
    <el-dialog title="筛选信息录入" :visible.sync="lifeDialogVisible" :close-on-click-modal="false" :before-close="closeDialog" v-on:open="loadData" style="margin-top: -50px" width="80%">
     
      <el-form :model="form" :inline="true" :rules="rules" ref="form" label-width="100px">
        <el-tabs v-model="activeName" @tab-click="tabClick">
         <!--  <el-tab-pane label="筛选者档案" name="first">
            <div>
              <el-row>
                <el-col>
                  <el-form-item label="姓名" prop="name" label-width="100px">
                    {{form.name}}
                  </el-form-item>
                  <el-form-item label="性别" prop="sex" labelWidth="40px">
                    {{form.sex}}
                  </el-form-item>
                  <el-form-item label="身份证号" prop="cardid" labelWidth="80px">
                    {{form.cardid}}
                  </el-form-item>
                  <el-form-item label="年龄"labelWidth="40px">
                    {{form.age}}
                  </el-form-item>
                </el-col>
              </el-row>
              <el-form-item label="筛选号" prop="subjectsNum">
                <el-input v-model="form.num"
                          :readonly="form.num!=undefined&&form.num!=''"></el-input>
              </el-form-item>
              <el-form-item label="招募日期" prop="recruitDate">
                <el-date-picker
                  v-model="form.recruitDate"
                  type="date"
                  placeholder="选择日期"
                  :readonly="true"
                  :picker-options="pickerOptions0">
                </el-date-picker>
              </el-form-item>
              <el-form-item label="联系电话" prop="mobile">
                <el-input v-model="form.mobile"></el-input>
              </el-form-item>
              <el-form-item label="联系地址" prop="address">
                <el-input v-model="form.address"></el-input>
              </el-form-item>
              <el-form-item label="紧急联系人" prop="urgentContact">
                <el-input v-model="form.urgentContact"></el-input>
              </el-form-item>
              <el-form-item label="紧急联系电话" prop="urgentMobile">
                <el-input v-model="form.urgentMobile"></el-input>
              </el-form-item>
            </div>

          </el-tab-pane>
          <el-tab-pane label="参与项目" name="third">
            <el-form :model="form" :inline="true" :rules="rules" ref="form" label-width="120px" class="demo-form">
              <el-form-item style="width: 100%">项目名称：{{form.projectName}}</el-form-item>
              <el-form-item label="筛选号" prop="num" style="width: 40%">{{form.num}}</el-form-item>
              <el-form-item label="招募日期" prop="recruitDate" style="width: 40%"></el-form-item>
              <el-form-item label="筛选结果" prop="candidateResult" style="width: 40%">
                {{candidateResult[form.candidateResult]}}
              </el-form-item> -->

              <!--<el-form-item label="受试者号" prop="subjectsNum" style="width: 40%">{{form.subjectsNum}}</el-form-item>-->

           <!--    <el-form-item label="随机号" prop="randomNum" style="width: 40%">{{form.randomNum}}</el-form-item>
              <el-form-item label="住院状态" prop="hospitalStatus" style="width: 40%">
                -
              </el-form-item>
              <el-form-item label="试验状态" prop="status" style="width: 40%">
                -
              </el-form-item>
            </el-form>
          </el-tab-pane>
 -->
             <el-tab-pane label="人口学资料" name="first">
                <el-row>
                  <el-col>
                    <el-form-item label="姓名:" prop="name" label-width="40px">
                      {{form.name}}
                    </el-form-item>
                    <el-form-item label="性别:" prop="sex" labelWidth="40px">
                      {{form.sex}}
                    </el-form-item>
                    <el-form-item label="身份证号:" prop="cardid" labelWidth="70px">
                      {{form.cardid}}
                    </el-form-item>
                    <el-form-item label="年龄:"labelWidth="40px">
                      {{form.age}}
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-form-item
                    label="体重(kg)"
                  >
                <el-input type="age" v-model.number="oweight"  @change='BIMalgorithm'></el-input>
              </el-form-item>
              <el-form-item
                    label="身高(cm)"
                  >
                <el-input type="age" v-model.number="oheight"   @change='BIMalgorithm'></el-input>
              </el-form-item>
              <el-row>
                  <el-col>
                    <el-form-item label="BMI指数:" prop="bmi" label-width="100px">
                      {{obmi}}
                    </el-form-item>
                    
                  </el-col>
                </el-row>
                   <el-row>
          <el-col :span="24" style="padding:10px;">
            <!-- <span style="color:red;float:left;">"*"为必填项。</span> -->
            <div class="pull-right">
              <!-- <el-button type="primary" @click.native="hrough">通过筛选</el-button> -->
              <el-button v-if="$utils.ckUIPower('S01010101')" type="primary" @click.native.prevent="demography" :disabled="editClick">保存
              </el-button>
              <!-- <el-button v-if="$utils.ckUIPower('S01010101')" @click.native.prevent="handleReset">重置</el-button> -->
              <el-button @click.native.prevent="closeDialog">取消</el-button>
                </div>
              </el-col>
            </el-row>
             </el-tab-pane>
             <el-tab-pane label="吸烟史" name="smoking">
                    <el-button type="primary" class="addBing" @click="addsmokeBox()">添加吸烟史</el-button>
                    <template>
                      <el-table
                        :data="smokeArr"
                        border
                        height="300"
                        style="width: 100%">
                        <el-table-column
                          prop="smoke_num"
                          label="吸烟数量"
                          width="180">
                        </el-table-column>
                       
                        <el-table-column
                          prop="start_time"
                          label="开始时间"
                          width="180">
                        </el-table-column>
                         <el-table-column
                          label="是否继续">
                          <template  slot-scope="scope">
             
                              {{smokeZI[scope.row.status]}}
                        </template>
                        </el-table-column>
                        <el-table-column
                          prop="end_time"
                          label="结束时间">
                        </el-table-column>
                        <el-table-column
                          fixed="right"
                          label="操作">
                          <template  slot-scope="scope">
             
                              <el-button type="text" @click.native="all_del(scope.row)">删除</el-button>
                        </template>
                        </el-table-column>
                      </el-table>
                    </template>
                     <el-col :span="24" style="padding:10px;">
           
                        <div class="pull-right">
                          <el-button type="primary" @click.native="hrough">通过筛选</el-button>
                         
                          </el-button>
                        
                          <el-button @click.native.prevent="closeDialog">取消</el-button>
                            </div>
                          </el-col>
                  
                  
             </el-tab-pane>
             <el-tab-pane label="过敏史" name="drinking">
                  <el-button type="primary" class="addBing" @click="Anaphylaxis()">添加过敏史</el-button>
                    <template>
                      <el-table
                        :data="allergyArr"
                        border
                        height="300"
                        style="width: 100%">
                        <el-table-column
                          prop="allergy"
                          label="过敏史详情"
                          width="800">
                        </el-table-column>
                       
                        <el-table-column
                          fixed="right"
                          label="操作">
                          <template  slot-scope="scope">
             
                                <el-button type="text" @click.native="all_del(scope.row)">删除</el-button>
                          </template>
                        </el-table-column>
                      </el-table>
                    </template>
                  <el-col :span="24" style="padding:10px;">
           
                        <div class="pull-right">
                          <el-button type="primary" @click.native="hrough">通过筛选</el-button>
                         
                          </el-button>
                        
                          <el-button @click.native.prevent="closeDialog">取消</el-button>
                            </div>
                          </el-col>
                  
             </el-tab-pane>
             
             
              <el-tab-pane label="病史" name="history">
                  <el-button type="primary" class="addBing"  @click='addMicisng()'>添加病史</el-button>
                  <template>
                    <el-table
                      :data="sickArr"
                      border
                      height="300"
                      style="width: 100%">
                      <el-table-column
                        prop="sick_name"
                        label="疾病名称"
                        width="180">
                      </el-table-column>
                      
                      <el-table-column
                        prop="start_time"
                        label="开始时间"
                        width="180">
                      </el-table-column>
                      <el-table-column
                        label="目前是否持续">
                        <template  slot-scope="scope">

                              {{continued[scope.row.status]}}
                        </template>
                      </el-table-column>
                      <el-table-column
                        prop="end_time"
                        label="结束时间">
                      </el-table-column>
                      <el-table-column
                        fixed="right"
                        label="操作">
                        <template  slot-scope="scope">
           
                            <el-button type="text" @click.native="all_del(scope.row)">删除</el-button>
                      </template>
                      </el-table-column>
                    </el-table>
                  </template>

                  <el-col :span="24" style="padding:10px;">
           
                        <div class="pull-right">
                          <el-button type="primary" @click.native="hrough">通过筛选</el-button>
                         
                          </el-button>
                        
                          <el-button @click.native.prevent="closeDialog">取消</el-button>
                            </div>
                          </el-col>
             </el-tab-pane>
             <el-tab-pane label="手术史" name="surgery">
              <el-button type="primary" class="addBing" @click="Operation()">添加手术史</el-button>
                <template>
                    <el-table
                      :data="surgeryArr"
                      border
                      height="300"
                      style="width: 100%">
                      <el-table-column
                        prop="surgery_name"
                        label="手术名称"
                        width="180">
                      </el-table-column>
                      <el-table-column
                        prop="time"
                        label="手术日期">
                      </el-table-column>
                    
                      <el-table-column
                        prop="bz"
                        label="备注">
                      </el-table-column>
                      <el-table-column
                        fixed="right"
                        label="操作">
                        <template  slot-scope="scope">
           
                            <el-button type="text" @click.native="all_del(scope.row)">删除</el-button>
                      </template>
                      </el-table-column>
                    </el-table>
                  </template>
                  <el-col :span="24" style="padding:10px;">
           
                        <div class="pull-right">
                          <el-button type="primary" @click.native="hrough">通过筛选</el-button>
                         
                          </el-button>
                        
                          <el-button @click.native.prevent="closeDialog">取消</el-button>
                            </div>
                          </el-col>
             </el-tab-pane>
             <el-tab-pane label="既往用药史" name="record">
                <el-button type="primary" class="addBing" @click="recordBox()">添加用药记录</el-button>
                  <template>
                    <el-table
                      :data="pharmacyArr"
                      border
                      height="300"
                      style="width: 100%">
                      <el-table-column
                        prop="pharmacy_name"
                        label="药物名称"
                        >
                      </el-table-column>
                      <el-table-column
                        prop="dosage"
                        label="剂量">
                      </el-table-column>
                      <el-table-column
                        prop="unit"
                        label="单位"
                        >
                      </el-table-column>
                      <el-table-column
                        prop="rate"
                        label="频率">
                      </el-table-column>
                      <el-table-column
                        prop="way"
                        label="给药途径">
                      </el-table-column>
                      <el-table-column
                        prop="start_time"
                        label="开始时间"
                        width="180">
                      </el-table-column>
                      <el-table-column
                        label="是否持续">
                        <template  slot-scope="scope">

                              {{continued[scope.row.status]}}
                        </template>
                      </el-table-column>
                      <el-table-column
                        prop="end_time"
                        label="结束时间"
                        width="180">
                      </el-table-column>
                      <el-table-column
                        fixed="right"
                        label="操作">
                        <template  slot-scope="scope">
           
                            <el-button type="text" @click.native="all_del(scope.row)">删除</el-button>
                      </template>
                      </el-table-column>
                    </el-table>
                  </template>
                  <el-col :span="24" style="padding:10px;">
           
                        <div class="pull-right">
                          <el-button type="primary" @click.native="hrough">通过筛选</el-button>
                         
                          </el-button>
                        
                          <el-button @click.native.prevent="closeDialog">取消</el-button>
                            </div>
                          </el-col>
             </el-tab-pane>
             <el-tab-pane label="生命体征" name="vitalSigns"> 
                   <el-button type="primary" class="addBing" @click="vitals()">添加生命体征</el-button>
                  <template>
                    <el-table
                      :data="vitalsign"
                      border
                      height="300"
                      style="width: 100%">
                      <el-table-column
                        label="阶段"
                        width="120">
                        <template  slot-scope="scope">
           
                            {{mentstage[scope.row.stage]}}
                      </template>
                        
                      </el-table-column>
                      <el-table-column
                        prop="systolic"
                        label="收缩压(mmHg)"
                        width="150">
                      </el-table-column>
                      <el-table-column
                        prop="diastolic"
                        label="舒张压(mmHg)"
                        width="150">
                      </el-table-column>
                      <el-table-column
                        prop="pulse"
                        label="脉搏(次/分)"
                        width="120">
                      </el-table-column>
                       <el-table-column
                        prop="breath"
                        label="呼吸(次/分)"
                         width="120"
                         >
                      </el-table-column>
                      <el-table-column
                        prop="temperature"
                        label="体温(℃)"
                         width="100">
                      </el-table-column>
                      <el-table-column
                        prop="time"
                        label="测量时间"
                         width="200">
                      </el-table-column>
                      <el-table-column
                        fixed="right"
                        label="操作"
                        width="200">
                        <template  slot-scope="scope">
                            <el-button type="text" @click.native="modifyLife(scope.row)">修改</el-button>
                            <el-button type="text" @click.native="all_del(scope.row)">删除</el-button>
                      </template>
                      </el-table-column>
                    </el-table>
                  </template>
                  <el-col :span="24" style="padding:10px;">
           
                        <div class="pull-right">
                          <el-button type="primary" @click.native="hrough">通过筛选</el-button>
                         
                          </el-button>
                        
                          <el-button @click.native.prevent="closeDialog">取消</el-button>
                            </div>
                          </el-col>
             </el-tab-pane>
             <el-tab-pane label="检验结果" name="results">  
                  <el-button type="primary" class="addBing" @click="testBox()">添加检验结果</el-button>
                  <template>
                    <el-table
                      :data="testArr"
                      border
                      height="300"
                      style="width: 100%">
                      <el-table-column
                        label="阶段"
                        width="120">
                        <template  slot-scope="scope">
           
                            {{mentstage[scope.row.stage]}}
                      </template>
                        
                      </el-table-column>
                      <el-table-column
                        prop="pro"
                        label="检验项目"
                        width="180">
                      </el-table-column>
                      <el-table-column
                        prop="type"
                        label="类别"
                        width="100">
                      </el-table-column>
                      <el-table-column
                        prop="val"
                        label="检验值"
                        width="100">
                      </el-table-column>
                      <el-table-column
                        prop="range"
                        label="参考范围"
                        width="100">
                      </el-table-column>
                      <el-table-column
                        prop="unit"
                        label="单位"
                        width="100">
                      </el-table-column>
                      <el-table-column
                        prop="judge"
                        label="临床意义判定"
                        width="160">
                      </el-table-column>
                      
                      <el-table-column
                        prop="time"
                        label="检验时间"
                        width="200">
                      </el-table-column>
                      <el-table-column
                        prop="explain"
                        label="异常数据解释"
                        width="180">
                      </el-table-column>
                      
                      <el-table-column
                        fixed="right"
                        label="操作"
                        width="100">
                        <template  slot-scope="scope">
           
                            <el-button type="text" @click.native="all_del(scope.row)">删除</el-button>
                      </template>
                      </el-table-column>
                    </el-table>
                  </template>
                  <el-col :span="24" style="padding:10px;">
           
                        <div class="pull-right">
                          <el-button type="primary" @click.native="hrough">通过筛选</el-button>
                         
                          </el-button>
                        
                          <el-button @click.native.prevent="closeDialog">取消</el-button>
                            </div>
                          </el-col>
             </el-tab-pane>
             <el-tab-pane label="问题列表" name="problems">  
                <template>
                    <el-table
                      :data="questionArr"
                      border
                      height="300"
                      style="width: 100%">
                      <el-table-column
                        prop="question"
                        label="问题描述"
                        width="900"
                        >
                      </el-table-column>
                      
                      <el-table-column
                        fixed="right"
                        label="操作" width="200">
                        <template  slot-scope="scope">
           
                             <el-radio-group v-model="scope.row.sid" @change.native="groupchange(scope.row)">
                                <el-radio :label="1">是</el-radio>
                                <el-radio :label="2">否</el-radio>
                              </el-radio-group>
                      </template>
                      </el-table-column>
                    </el-table>
                      <el-row>
          <el-col :span="24" style="padding:10px;">
            <!-- <span style="color:red;float:left;">"*"为必填项。</span> -->
            <div class="pull-right">
            <el-button type="primary" @click.native="hrough">通过筛选</el-button>

              <el-button type="primary" @click.native.prevent="preservation">保存
              </el-button>

              <!-- <el-button v-if="$utils.ckUIPower('S01010101')" @click.native.prevent="handleReset">重置</el-button> -->
              <el-button @click.native.prevent="closeDialog">取消</el-button>
                </div>
              </el-col>
            </el-row>
                  </template>
             </el-tab-pane>
        </el-tabs>
        
      </el-form>

    </el-dialog>
    
    <result-dialog :result-dialog-visible="resultDialog.show" :id="currentSubjectsId" :num="currentSubjectsNum"
                   @closeResultDialog="closeResultDialog"></result-dialog>
  </div>
</template>

<script>
  import http from '../../../api/http'
  import ResultDialog from './result.dialog.vue'
  var model = {

    num: '',
    sex: '',
    mobile: '',
    address: '',
    urgentContact: '',
    urgentMobile: '',
    fingerprint: '',
    finger: '',
    name: '',
    cardid: '',//
    randomNum: '',
    candidateNum: '',
    testStatus: '',
    hospitalStatus: '',
    passTime: '',
    age: '',
    weight:'',


  };
  export default {
    data () {
      return {

        //病史参
        sick_name:'',
        sick_end_time:'',
        sick_start_time:'',
        sick_status:'',
        //过敏史参
        Anaphy:'',
        //吸烟室参
        smoke_start_time:'',
        smoke_end_time:'',
        smoke_num:'',
        smoke_status:'',
        //手术史参
        surgery_bz:'',
        surgery_time:'',
        surgery_name:'',
        //用药记录参
        pharmacy_name:'',
        pharmacy_dosage:'',
        pharmacy_unit:'',
        pharmacy_rate:'',
        pharmacy_way:'',
        pharmacy_start_time:'',
        pharmacy_end_time:'',
        pharmacy_status:'',
        //生命体征参
        shrink:'',
        pulse:'',
        diastole:'',
        breathing:'',
        temperature:'',
        ostage:'',
        sign_time:'',
        //检验参
        examine_stage:'',
        examine_time:'',
        examine_range:'',
        examine_val:'',
        examine_pro:'',
        examine_type:'',
        examine_unit:'',
        examine_judge:'',
        examine_explain:'',
        resultDialog: {show: false},
        currentSubjectsNum: '',
        currentSubjectsId: '',
        vitalsign:[],
         determine:[{
          name:'1'
        },{
          name:'2'
        },{
          name:'3'
        },{
          name:'4'
        }],
        mentstage:{
          1:'筛选期',
          2:'治疗期',
        },
        stageArr:[{
          id:1,
          name:"筛选期"
        },{
          id:2,
          name:"治疗期"
        }],
        oweight:'',
        oheight:'',
        obmi:'',
        allergyArr:[],
        pharmacyArr:[],
        sickArr:[],
        smokeArr:[],
        surgeryArr:[],
        testArr:[],
        questionArr:[],
        pharmacyWay:[{
          name:'口服'
        },{
          name:'注射'
        }],
        oExamine:[{
          name:'血常规'
        },{
          name:'尿常规'
        }],
        smokeZI:{
          1:"吸烟",
          2:"已戒烟"
        },
        continued:{
          1:"是",
          2:"否"
        },
        historyGroup: [{
          startDate: '2016-05-03',
          historyname: '病史1',
          endDate: '2017-05-03',
          operativeName:"心脏病"
        },{
          startDate: '2016-05-03',
          historyname: '病史2',
          endDate: '2017-05-03',
          operativeName:"心脏病"

        }],
        editClick:false,
        picHead: '',
        activeName: 'first',
        projectName: '',
        pickerOptions0: {
          disabledDate(time) {
            return time.getTime() < Date.now() - 8.64e7;
          }
        },
        title: '',
        form: Object.assign({}, model),
        rules: {},                  //校验规则
        informationList: [],        //存储受试者详细信息
        addBtnTxt: '',
        siteList: [],
        read: false,
        candidateResult:['-','成功','失败'],
        isMedical:false,
        isSigns:false,
        isSmoking:false,
        isAnaphylaxis:false,
        isOperation:false,
        isrecord:false,
        istestBox:false,
        prome:[],
        temperature:[],
        lifeId:'',
      }
    },
    props: {
      lifeDialogVisible: {
        type: Boolean,
        default: false
      },
       subjectId: {type: String}
    },
    methods: {
      //点击对应标签时加载
      tabClick(tab){
        switch (tab.name) {
          case 'first'://特征
            break;
          case 'second':
            break;
          case 'third':
            break;
            case 'features':
            break;
            case 'smoking'://吸烟史
            break;
            case 'history'://病史
            break;
            case 'surgery'://手术史
            break;
            case 'record'://用药记录
            break;
            case 'vitalSigns'://生命体征
            break;
            case 'results'://检验结果
            break;
            case 'problems'://问题列表
            break;
            case 'drinking'://饮酒史
            break;

        }
      },
      //通过筛选按钮
      hrough(){
        // console.log(this.form.id)
        var vm = this;
        let category='question';
        http.postData(vm, "/pt/screening/myhistory", {subid:vm.subjectId,json:JSON.stringify(vm.prome),category:category}, function (resp) {
              var ret = resp.body;
            console.log(resp)

              if (ret.code === '111') {
                
                // vm.$notify({title: '操作提示', message: ret.msg, type: 'success'});
                vm.comeclie(vm.subjectId);
                // vm.prome=[];
                vm.currentSubjectsNum = vm.form.subjectsNum;
                vm.currentSubjectsId = vm.form.id;
                vm.resultDialog.show = true;
                // vm.closeDialog();
                // vm.$parent.onSubmit();
              }else if(ret.code === '222'){
                vm.$confirm(ret.msg+'， 但已保存，如需修改请点击取消，重新保存，如果强制通过筛选请点击确定', '提示', {
                        confirmButtonText: '确定',
                        type: 'warning'
                      }).then(() => {
                        vm.$message({
                          type: 'success',
                          message: '保存成功!'
                        });
                        vm.comeclie(vm.subjectId);
                      
                                vm.currentSubjectsNum = vm.form.subjectsNum;
                          vm.currentSubjectsId = vm.form.id;
                          vm.resultDialog.show = true;
                      }).catch(() => {
                        vm.$message({
                          type: 'info',
                          message: '请重新保存'
                        });   
                      });

              } else {
                // vm.editClick = false;
                vm.$notify.error({title: '操作失败', message: ret.msg});
              }
            });
        
      },
      preservation(){
        var vm = this;
        let category='question';
        http.postData(vm, "/pt/screening/myhistory", {subid:vm.subjectId,json:JSON.stringify(vm.prome),category:category}, function (resp) {
              var ret = resp.body;
              // console.log(vm.prome)
            // console.log(resp)

              if (ret.code === '111') {
                
                vm.$notify({title: '操作提示', message: ret.msg, type: 'success'});
                vm.comeclie(vm.subjectId);
                // vm.prome=[];
                // vm.closeDialog();
                // vm.$parent.onSubmit();
              }else if(ret.code === '222'){
                vm.$notify({title: '操作提示', message: '保存成功！', type: 'success'});
                vm.comeclie(vm.subjectId);
                   vm.comeclie(vm.subjectId);
              } else {
                // vm.editClick = false;
                vm.$notify.error({title: '操作失败', message: ret.msg});
              }
            });
      },
     all_del(row){
        var vm = this;

        // console.log(row);
         http.postData(vm, "/pt/screening/myhistoryDelete", {subid:row.subjects_id,id:row.id,category:row.category}, function (resp) {
              var ret = resp.body;
            // console.log(resp)

              if (ret.code === '111') {
                
                vm.$notify({title: '操作提示', message: ret.msg, type: 'success'});
                vm.comeclie(row.subjects_id);
                // vm.closeDialog();
                // vm.$parent.onSubmit();
              } else {
                // vm.editClick = false;
                vm.$notify.error({title: '操作失败', message: ret.msg});
              }
            });
     },
     //关闭检验结果按钮
     addtestClose(){
       var vm = this;

        vm.istestBox=false;
                vm.examine_time='';
                vm.examine_range='';
                vm.examine_val='';
                vm.examine_pro='';
                vm.examine_type='';
                vm.examine_unit='';
                vm.examine_judge='';
                vm.examine_explain='';
                vm.examine_stage="";
     },
     //添加检验结果按钮
     addtest(){
       var vm = this;
         let category='examine';
        http.postData(vm, "/pt/screening/myhistory", {category:category,subid:vm.subjectId,type:vm.examine_type,pro:vm.examine_pro,val:vm.examine_val,time:vm.examine_time,range:vm.examine_range,unit:vm.examine_unit,judge:vm.examine_judge,explain:vm.examine_explain,stage:vm.examine_stage}, function (resp) {
              var ret = resp.body;
            // console.log(resp)

              if (ret.code === '111') {
                vm.istestBox=false;
                vm.examine_time='';
                vm.examine_range='';
                vm.examine_val='';
                vm.examine_pro='';
                vm.examine_type='';
                vm.examine_unit='';
                vm.examine_judge='';
                vm.examine_explain='';
                vm.examine_stage="";
                vm.$notify({title: '操作提示', message: ret.msg, type: 'success'});
                vm.comeclie(vm.subjectId);
                // vm.closeDialog();
                // vm.$parent.onSubmit();
              } else {
                // vm.editClick = false;
                vm.$notify.error({title: '操作失败', message: ret.msg});
              }
            });
     },
     closeResultDialog(subjects) {
        this.resultDialog.show = false;
        // this.tagDialog.form.nopassRemark ='';
        // this.tagDialog.form.randomNum='';
        // this.tagDialog.form.candidateResult='1';
        // if (subjects != undefined && subjects.id != ''){
        //   this.tagDialog.show = true;
        //   this.tagDialog.subjectsId =subjects.id;
        //   this.tagDialog.subjectsNum=subjects.num;
        // }
      },
     //添加检验结果弹出框
     testBox(){
       var vm = this;
          vm.istestBox=true;
     },
      //关闭用药记录
      isrecordClose(){
              

        var vm = this;
          vm.isrecord=false;
        vm.pharmacy_name='';
                vm.pharmacy_dosage='';
                vm.pharmacy_unit='';
                vm.pharmacy_rate='';
                vm.pharmacy_way='';
                vm.pharmacy_start_time='';
                vm.pharmacy_end_time='';
                vm.pharmacy_status='';
      },
      //添加用药记录
      addoRecord(){

        var vm = this;
          let category='pharmacy';
        http.postData(vm, "/pt/screening/myhistory", {category:category,subid:vm.subjectId,pharmacy_name:vm.pharmacy_name,dosage:vm.pharmacy_dosage,unit:vm.pharmacy_unit,rate:vm.pharmacy_rate,way:vm.pharmacy_way,start_time:vm.pharmacy_start_time,end_time:vm.pharmacy_end_time,status:vm.pharmacy_status}, function (resp) {
              var ret = resp.body;

              if (ret.code === '111') {
                vm.isrecord=false;
                vm.pharmacy_name='';
                vm.pharmacy_dosage='';
                vm.pharmacy_unit='';
                vm.pharmacy_rate='';
                vm.pharmacy_way='';
                vm.pharmacy_start_time='';
                vm.pharmacy_end_time='';
                vm.pharmacy_status='';
                vm.$notify({title: '操作提示', message: ret.msg, type: 'success'});
                vm.comeclie(vm.subjectId);
                // vm.closeDialog();
                // vm.$parent.onSubmit();
              } else {
                // vm.editClick = false;
                vm.$notify.error({title: '操作失败', message: ret.msg});
              }
            });
      },
      groupchange(row){
          var vm=this;
       
        for(var i=0;i<vm.prome.length;i++){
            
          if(vm.prome[i].ques==row.id&&vm.prome[i].answer==row.sid){
            return;
          }
          if(vm.prome[i].ques==row.id&&vm.prome[i].answer!=row.sid){
            vm.prome.splice(i,1);
          }
        }

          let obj={
            ques:row.id,
            answer:row.sid
          };
          vm.prome.push(obj);
          // JSON.stringify(vm.prome);

      },
      //病史提交 和关闭
      Medicalclose(){
        var vm = this;
         vm.isMedical=false;
                vm.sick_name='';
                vm.sick_end_time='';
                vm.sick_start_time='';
                vm.sick_status='';
      },
      addMedical(){
        var vm = this;
          let category='sick';
        http.postData(vm, "/pt/screening/myhistory", {category:category,subid:vm.subjectId,sick_name:vm.sick_name,status:vm.sick_status,start_time:vm.sick_start_time,end_time:vm.sick_end_time}, function (resp) {
              var ret = resp.body;
            // console.log(resp)

              if (ret.code === '111') {
                vm.isMedical=false;
                vm.sick_name='';
                vm.sick_end_time='';
                vm.sick_start_time='';
                vm.sick_status='';
                vm.$notify({title: '操作提示', message: ret.msg, type: 'success'});
                vm.comeclie(vm.subjectId);
                // vm.closeDialog();
                // vm.$parent.onSubmit();
              } else {
                // vm.editClick = false;
                vm.$notify.error({title: '操作失败', message: ret.msg});
              }
            });
      },
      //关闭吸烟史
      SmokClose(){
          var vm = this;

        vm.isSmoking=false;
                vm.smoke_start_time='';
                vm.smoke_end_time='';
                vm.smoke_num='';
                vm.smoke_status='';
      },
      //添加吸烟史数据
      addSmoking(){
          var vm = this;
          let category='smoke';
        http.postData(vm, "/pt/screening/myhistory", {category:category,subid:vm.subjectId,smoke_num:vm.smoke_num,status:vm.smoke_status,start_time:vm.smoke_start_time,end_time:vm.smoke_end_time}, function (resp) {
              var ret = resp.body;
            // console.log(resp)

              if (ret.code === '111') {
                vm.isSmoking=false;
                vm.smoke_start_time='';
                vm.smoke_end_time='';
                vm.smoke_num='';
                vm.smoke_status='';
                vm.$notify({title: '操作提示', message: ret.msg, type: 'success'});
                vm.comeclie(vm.subjectId);
                // vm.closeDialog();
                // vm.$parent.onSubmit();
              } else {
                // vm.editClick = false;
                vm.$notify.error({title: '操作失败', message: ret.msg});
              }
            });
      },
      //添加用药记录弹出框
      recordBox(){
        var vm=this;
        vm.isrecord=true;
          
      },
      //关闭添加手术史
      erationClose(){
           var vm = this;
        vm.isOperation=false;
                vm.surgery_bz='';
                vm.surgery_time='';
                vm.surgery_name='';
      },
      //添加手术史
      addOperation(){
           var vm = this;
          let category='surgery';
        http.postData(vm, "/pt/screening/myhistory", {category:category,subid:vm.subjectId,surgery_name:vm.surgery_name,time:vm.surgery_time,bz:vm.surgery_bz}, function (resp) {
              var ret = resp.body;
            // console.log(resp)

              if (ret.code === '111') {
                vm.isOperation=false;
                vm.surgery_bz='';
                vm.surgery_time='';
                vm.surgery_name='';
                vm.$notify({title: '操作提示', message: ret.msg, type: 'success'});
                vm.comeclie(vm.subjectId);
                // vm.closeDialog();
                // vm.$parent.onSubmit();
              } else {
                // vm.editClick = false;
                vm.$notify.error({title: '操作失败', message: ret.msg});
              }
            });
      },
      //添加手术史弹出框
      Operation(){
          var vm=this;
        vm.isOperation=true;
      },
      //关闭添加过敏史
      AnaphyClose(){
         var vm = this;
        vm.isAnaphylaxis=false;
         vm.Anaphy='';
      },
      //添加过敏史
      addAnaphy(){
         var vm = this;
          let category='allergy';
        http.postData(vm, "/pt/screening/myhistory", {category:category,subid:vm.subjectId,allergy:vm.Anaphy}, function (resp) {
              var ret = resp.body;
            // console.log(resp)

              if (ret.code === '111') {
                vm.isAnaphylaxis=false;
                vm.Anaphy='';
                vm.$notify({title: '操作提示', message: ret.msg, type: 'success'});
                vm.comeclie(vm.subjectId);
                // vm.closeDialog();
                // vm.$parent.onSubmit();
              } else {
                // vm.editClick = false;
                vm.$notify.error({title: '操作失败', message: ret.msg});
              }
            });
      },
      //添加过敏史弹出框
      Anaphylaxis(){

        var vm=this;
        vm.isAnaphylaxis=true;
      },
      //添加吸烟BOX弹出框
      addsmokeBox(){
          var vm=this;
        vm.isSmoking=true;

      },
      // 关闭生命体征接口
      VitalClose(){
        var vm = this;
        vm.isSigns=false;
        vm.shrink='';
        vm.pulse='';
        vm.diastole='';
        vm.breathing='';
        vm.temperature='';
        vm.ostage='';
        vm.sign_time='';
        vm.lifeId='';

      },
      // 添加生命体征接口
      addVital(){
         var vm = this;
          let category='vitalsign';
          if(vm.ostage=="筛选期"){
            vm.ostage=1;
          }else if(vm.ostage=="治疗期"){
            vm.ostage=2;

          }
        http.postData(vm, "/pt/screening/myhistory", {category:category,subid:vm.subjectId,systolic:vm.shrink,diastolic:vm.diastole,pulse:vm.pulse,breath:vm.breathing,temperature:vm.temperature,stage:vm.ostage,time:vm.sign_time,changeid:vm.lifeId}, function (resp) {
              var ret = resp.body;
            // console.log(resp)

              if (ret.code === '111') {
                vm.isSigns=false;
                vm.shrink='';
                vm.pulse='';
                vm.diastole='';
                vm.breathing='';
                vm.temperature='';
                vm.ostage='';
                vm.sign_time='';
                vm.lifeId='';
                vm.$notify({title: '操作提示', message: ret.msg, type: 'success'});
                vm.comeclie(vm.subjectId);
                // vm.closeDialog();
                // vm.$parent.onSubmit();
              } else {
                // vm.editClick = false;
                vm.$notify.error({title: '操作失败', message: ret.msg});
              }
            });
      },
      // 添加生命体征弹出框
      vitals(){
        var vm=this;
        vm.isSigns=true;
      },
      modifyLife(row){
        var vm=this;
        vm.isSigns=true;
        console.log(row)
        http.postData(vm, "/pt/screening/vitalsignChange", {id:row.id}, function (resp) {
              var ret = resp.body;
            // console.log(resp)
              vm.shrink=ret.value.systolic;
              vm.pulse=ret.value.pulse;
              vm.lifeId=row.id;
              vm.diastole=ret.value.diastolic;
              vm.sign_time=ret.value.time;
              vm.temperature=ret.value.temperature;
              vm.breathing=ret.value.breath;
              if(ret.value.stage==1){
                  vm.ostage="筛选期";
              }else if(ret.value.stage==2){
                  vm.ostage="治疗期";

              }
              
              // if (ret.code === '111') {
              //   vm.$notify({title: '操作提示', message: ret.msg, type: 'success'});
              //   // vm.closeDialog();
              //   // vm.$parent.onSubmit();
              // } else {
              //   // vm.editClick = false;
              //   vm.$notify.error({title: '操作失败', message: ret.msg});
              // }
            });
      },
      // 添加病史按钮
      addMicisng(){
        var vm=this;
        vm.isMedical=true;
      },
      // BMI指数计算
      BIMalgorithm(){
        var vm=this;
        // vm.BMI=vm.from.weight/(vm.from.height*vm.from.height);
        if(vm.oweight!=''&&vm.oheight!=''){
          let tsheight=vm.oheight/100;
          let Bim=vm.oweight/(tsheight*tsheight);
          vm.obmi=Bim.toFixed(2);
          // console.log(vm.form.BMI)
        }else{
          vm.obmi='';
        }
        
      },
       getTime(date){
            this.smoke_start_time=date;
          },
           getTime1(date){
            this.smoke_end_time=date;
          },
           getTime2(date){
            this.sick_start_time=date;

          },
           getTime3(date){
            this.sick_end_time=date;
            
          },
          getTime4(date){
            this.surgery_time=date;
            
          },
          getTime5(date){
            this.pharmacy_start_time=date;
            
          },
          getTime6(date){
            this.pharmacy_end_time=date;
            
          },
           getTime7(date){
            this.examine_time=date;
            
          },
          getTime8(date){
            this.sign_time=date;
            
          },
      readID() {
        this.read = true;
      },
      handleReset () {
        this.$refs.form.resetFields();
        this.editClick = false;
        this.form.age = null;
        this.form.num = null;
      },
      // 保存第一个
      demography(){

        var vm = this;
        // console.log(vm.subjectId)
        http.postData(vm, "/pt/screening/humenData", {weight:vm.oweight,height:vm.oheight,bmi:vm.obmi,subid:vm. subjectId}, function (resp) {
              var ret = resp.body;
            // console.log(resp)

              if (ret.code === '111') {
                vm.$notify({title: '操作提示', message: ret.msg, type: 'success'});
                // vm.closeDialog();
                // vm.$parent.onSubmit();
              } else {
                // vm.editClick = false;
                vm.$notify.error({title: '操作失败', message: ret.msg});
              }
            });
      },
      comeclie(row){
        var vm = this;
        // console.log(row)
         http.postData(vm, "/pt/screening/myhistoryList", {subid:row}, function (resp) {
              var ret = resp.body;
            // console.log(resp)
                vm.prome=[];
                vm.questionArr=ret.value.question;

                  for(var i=0;i<vm.questionArr.length;i++){
                      
                    
                    let obj={
                      ques:vm.questionArr[i].id,
                      answer:vm.questionArr[i].sid
                    };
                    vm.prome.push(obj);
                  }
              if (ret.code === '111') {
                vm.allergyArr=ret.value.allergy;
                vm.pharmacyArr=ret.value.pharmacy;
                vm.sickArr=ret.value.sick;
                vm.smokeArr=ret.value.smoke;
                vm.surgeryArr=ret.value.surgery;
                vm.testArr=ret.value.examine;

                vm.questionArr=ret.value.question;
                

       
                vm.oweight=ret.value.humen.weight;
                vm.oheight=ret.value.humen.height;
                vm.obmi=ret.value.humen.BMI;
                vm.vitalsign=ret.value.vitalsign;

                // vm.$notify({title: '操作提示', message: ret.msg, type: 'success'});
                // vm.closeDialog();
                // vm.$parent.onSubmit();
              } else {
                // vm.editClick = false;
                // vm.$notify.error({title: '操作失败', message: ret.msg});
              }
            });
      },
      handleSubmit (ev) {
        var vm = this;
        this.$refs.form.validate(function (valid) {
          if (valid) {
            vm.editClick = true;
            var roleIds = vm.form.roleIds;
            if (roleIds != undefined && roleIds.length > 0) {
              vm.form.roleName = "";
              vm.roleList.forEach(function (r) {
                if (roleIds.indexOf(r.id) >= 0) {
                  vm.form.roleName += " " + r.name;
                }
              });
            } else {
              vm.form.roleName = "";
            }
            http.postData(vm, "/pt/candidateSubjects/save", {json: JSON.stringify(vm.form)}, function (resp) {
              var ret = resp.body;
              if (ret.code === '111') {
                vm.$notify({title: '操作提示', message: ret.msg, type: 'success'});
                vm.form = Object.assign({}, model);
                vm.closeDialog();
                vm.$parent.onSubmit();
              } else {
                vm.editClick = false;
                vm.$notify.error({title: '操作失败', message: ret.msg});
              }
            });
          } else {
            return false
          }
        })
      }, closeDialog(){
        this.editClick = false;
        this.$emit('closeLifeDialog');
        this.prome=[];
        this.form = {};
      },
      loadData(){
        var vm = this;
        if (vm.$parent.currentCandidateID != undefined && vm.$parent.currentCandidateID != '') {
          http.postData(vm, "/pt/candidateSubjects/detail/" + vm.$parent.currentCandidateID, {}, function (resp) {
            var ret = resp.body;
            if(ret.code == 111){
              vm.form = ret.value;
            }
          });
        }
      }
    },
    components: {
      ResultDialog
    },
    created() {
      
      var vm = this;
    }
  }
</script>
<style>
  .readID {
    width: 70%;
    height: 100px;
    border-radius: 6px;
    border: 2px solid #ccc;
    margin: auto;
    font-size: 26px;
    font-weight: bold;
    color: #cccccc;
    text-align: center;
    line-height: 100px;
    cursor: pointer;
    margin-bottom: 20px;
  }

  .title {
    width: 100px;
    border: 1px solid #ccc;
    border-radius: 4px;
    height: 30px;
    text-align: center;
    line-height: 30px;
    color: #444444;
  }

  .wrapper {
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
    margin-bottom: 10px;
  }
  .numbeiss{
    width:130px;

  }
  .numbeissBox{
    margin-top: 30px;
  }
  .addBing{
    margin-bottom: 10px;

  }
  .Signs .el-input{
    max-width: 120px;
  }
  .Signs .demo-input-suffixs .el-input{
    max-width: 180px;
  }
  .Signs .demo-input-suffix{
    margin-bottom: 20px;
  }
  .Signsoo .demo-input-suffix{
     margin-bottom: 20px;
  }
  .addBingRight{
    float:right;
  }
  .el-dialog--small{
    width:75%;
  }
  .isrecordDd .demo-input-suffix{
    margin-bottom: 20px;
  }
  .widss .el-dialog--small{
    width:50%;
  }
  .colssro{
    color:#78c5a5;
    line-height: 24px;
    font-size: 12px;
  }
  .inputtext{
    margin:20px 0;
  }
  .guomin{
    margin-top: 20px;
    float:right;
  }
  .isAnaphylaxis-dialog .el-dialog--small{
      width:40%;
      margin:0 auto;
  }
  .isAnaphylaxis-dialog .el-textarea__inner{
    height:150px;
  }
  .isMedical-dialog .el-dialog--small{
     width:30%;
      margin:0 auto;
  }
  .isOperation-dialog .el-dialog--small{
  width:50%;
      margin:0 auto;
  }
  .isOperation-dialog .el-textarea__inner{
    height:150px;
  }
.isrecordWWW{
  display:inline-block;
  width:80px;
}
.isrecord-dialog .el-dialog--small{
  width:50%;
      margin:0 auto;
}
.spanWW{
  display:inline-block;
  width:80px;
}
.input-isss .el-textarea__inner{
  height:150px;
}
</style>
